﻿//-----------------------------------------------------------------------
// <copyright file="WelcomeStep.cs" company="QUT">
//     Copyright QUT 2009.
// </copyright>
//-----------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using GenerateKml.Properties;

namespace GenerateKml.Steps
{
    /// <summary>
    /// Welcome Step.
    /// </summary>
    public partial class WelcomeStep : UserControl
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="WelcomeStep"/> class.
        /// </summary>
        public WelcomeStep()
        {
            this.InitializeComponent();
        }

        /// <summary>
        /// Handles the Load event of the WelcomeStep control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void WelcomeStep_Load(object sender, EventArgs e)
        {
            this.ShowWelcomeScreenCheckBox.Checked = Configuration.ShowWelcomeScreen;
        }

        /// <summary>
        /// Handles the CheckedChanged event of the ShowWelcomeScreenCheckBox control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void ShowWelcomeScreenCheckBox_CheckedChanged(object sender, EventArgs e)
        {
            if (!this.ShowWelcomeScreenCheckBox.Checked)
            {
                MessageBox.Show("The Welcome Screen will be disabled the next time you launch the application.\n\nShould you ever wish to view the Welcome Screen again, simply go to the menu option and select Welcome Screen.", "Please Note", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            Configuration.ShowWelcomeScreen = this.ShowWelcomeScreenCheckBox.Checked;
            Configuration.Save();
        }
    }
}
